﻿namespace Sidvall.Data
{
    public static class DataRowItemManager
    {
        #region Public Members

        #region CreateDataRowItem

        public static DataRowItem<TField> CreateDataRowItem<TField>(string key)
        {
            if (key == null)
                return null;
            var dataRowItem = new DataRowItem<TField>()
            {
                Key = key,
                FieldValueItems = new FieldValueItemCollection<TField>(),
            };
            return dataRowItem;
        }
        public static DataRowItem<TField> CreateDataRowItem<TField>(IDataRowContextProvider item)
        {
            return CreateDataRowItem<TField>(item?.DataRowContextStorageKey);
        }

        #endregion

        #endregion
    }
}
